{{include template('public/header','admin')}}
<body>
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <form method="post" action="/admin/friendlink/batchremove" class="form-inline validform" role="form">
                    <table id='FriendlinkList' class="table table-condensed table-hover table-striped tablesorter table-fixed table-selectable">
                        <thead>
                            <tr>
                                <th style="width: 15px;"> <input type="checkbox" name="chk" class="checkbox" onclick="checkAll('prefix', this.form, 'ids', 'chk')" /></th>
                                <th style="width: 60px;">{{L('friendlink_displayorder')}}</th>
                                <th>{{L('friendlink_name')}}</th>
                                <th>{{L('friendlink_url')}}</th>
                                <th>{{L('friendlink_description')}}</th>
                                <th>{{L('friendlink_logo')}}</th>
                                <th style="width: 50px;">{{L('group')}}1</th>
                                <th style="width: 50px;">{{L('group')}}2</th>
                                <th style="width: 50px;">{{L('group')}}3</th>
                                <th style="width: 50px;">{{L('group')}}4</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{foreach $items as $item}}
                            {{$type = sprintf('%04b', $item['type'])}}
                            <tr>
                                <td><input type="checkbox" class="checkbox" name="ids[]" value="{{$item.id}}" /></td>
                                <td ><input type="text" class="form-control" name="displayorder[{{$item.id}}]" value="{{$item.displayorder}}" size="3" datatype="n"></td>
                                <td ><input type="text" class="form-control" name="name[{{$item.id}}]" value="{{$item.name}}"size="10" onkeyup="this.value = this.value.replace(/[^u4e00-u9fa5w]/g, '');"></td>
                                <td ><input type="text" class="form-control" name="url[{{$item.id}}]" value="{{$item.url}}" datatype="url"></td>
                                <td ><input type="text" class="form-control" name="description[{{$item.id}}]" value="{{$item.description}}" ></td>
                                <td ><input type="text" class="form-control" name="logo[{{$item.id}}]" value="{{$item.logo}}" ></td>
                                <th><input type="checkbox" name="portal[{{$item.id}}]" value="1" class="checkbox"{{if $type[0]}}checked{{/if}}></th>
                                <th><input type="checkbox" name="forum[{{$item.id}}]" value="1" class="checkbox"{{if $type[1]}}checked{{/if}}></th>
                                <th><input type="checkbox" name="group[{{$item.id}}]" value="1" class="checkbox"{{if $type[2]}}checked{{/if}}></th>
                                <th><input type="checkbox" name="portal[{{$item.id}}]" value="1" class="checkbox"{{if $type[3]}}checked{{/if}}></th>
                            </tr>
                            {{/foreach}}
                        </tbody>
                        <tr>
                            <td style="width: 15px;"></td>
                            <td colspan="9">
                                <div><a href="###" onclick="addrow(this, 0)" class="addtr">{{L('add')}} {{L('friendlink')}}</a></div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="15">
                                <div class="form-inline " style="text-align: left;">
                                    <div  style="float: left;">
                                        <input type="checkbox" name="chkall" class="checkbox" onclick="checkAll('prefix', this.form, 'ids')" />{{L('chkall')}}
                                        <input type="radio" class="radio" id="optype_outer" name="optype" value="del" />{{L('delete')}}
                                        <input type="submit" class="btn" name="sendsubmit" value="{{L('submit')}}" />
                                    </div>
                                    <div  style="float:right;">
                                        {{include template('public/page','admin')}}
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
    <script>
        var rowtypedata = [
            [
                [0, '', 'td25'],
                [0, '<input type="text" class="form-control" name="newdisplayorder[]" size="3" datatype="n" value="0">', 'td28'],
                [0, '<input type="text" class="form-control" name="newname[]" size="10" datatype="*" onkeyup="this.value=this.value.replace(/[^u4e00-u9fa5w]/g,\'\');">'],
                [0, '<input type="text" class="form-control" name="newurl[]" datatype="url">'],
                [0, '<input type="text" class="form-control" name="newdescription[]">', 'td26'],
                [0, '<input type="text" class="form-control" name="newlogo[]" >'],
                [0, '<input type="checkbox" name="newportal[{n}]" value="1" class="checkbox">'],
                [0, '<input type="checkbox" name="newforum[{n}]" value="1" class="checkbox">'],
                [0, '<input type="checkbox" name="newgroup[{n}]" value="1" class="checkbox">'],
                [0, '<input type="checkbox" name="newhome[{n}]" value="1" class="checkbox">']
            ]
        ]
    </script>
    <script type="text/javascript">
        $(function () {
            $(".validform").Validform({
                tiptype: 1, showAllError: false
            });
        });
    </script>
</body>
</html>



